namespace NavigateExample.Services.Dialog
{
    /// <summary>
    /// 对话框感知接口，对话框ViewModel实现此接口可以接收对话框参数
    /// </summary>
    public interface IDialogAware
    {
        /// <summary>
        /// 对话框标题
        /// </summary>
        string Title { get; }

        /// <summary>
        /// 对话框关闭时触发的事件
        /// </summary>
        event Action<IDialogResult> RequestClose;

        /// <summary>
        /// 对话框打开时调用
        /// </summary>
        /// <param name="parameters">对话框参数</param>
        void OnDialogOpened(DialogParameters parameters);

        /// <summary>
        /// 对话框关闭时调用
        /// </summary>
        void OnDialogClosed();

        /// <summary>
        /// 检查是否可以关闭对话框
        /// </summary>
        /// <returns>是否允许关闭</returns>
        bool CanCloseDialog();
    }
}